#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
	int n,cnt = 0;
	scanf("%d",&n);
	char s[n];
	scanf("%s",s);
	for(int i = n-1;i>0;i--)
	{
		if(s[i]==s[i-1]) cnt++;
	}
	printf("%d\n",cnt);
}
